<template>
  <el-card>
    <el-row :gutter="20">
      <el-col :span="10">
        <el-input
          placeholder="请输入内容"
          class="input-with-select"
          v-model="reqData.query"
        >
          <el-button slot="append" icon="el-icon-search" @click="sreach">
          </el-button>
        </el-input>
      </el-col>
      <el-col :span="4">
        <el-button type="primary" @click="openDialog">添加用户</el-button>
      </el-col>
      <add-user :userForm="userForm"/>
    </el-row>
  </el-card>
</template>

<script>
import addUser from './addUser'
export default {
  data() {
    return {
      reqData: {
        query: "",
        pagenum: 1,
        pagesize: 1,
      },
      userForm:{
        username:'',
        password:'',
        email:'',
        mobile:''
      },
    };
  },
  components:{
    addUser
  },
  methods: {
    /* 搜索功能 */
    sreach() {
      this.$store.dispatch("getUser", this.reqData);
    },
     /* 打开验证表单 */
    openDialog() {
      this.Isdialog = !this.Isdialog;
    },
  },
};
</script>

<style>
</style>